package com.gas.project.gas.resit.domain;

import java.math.BigDecimal;

import com.gas.framework.aspectj.lang.annotation.Excel;
import com.gas.framework.web.domain.BaseEntity;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

/**
 * 补考得分对象 gas_course_resit
 *
 * @author xyl
 * @date 2022-04-04
 */
public class CourseResit extends BaseEntity {
    private static final long serialVersionUID = 1L;

    /**
     * 补考
     */
    private Long courseResitId;

    /**
     * 课程编号
     */
    @Excel(name = "课程编号")
    private String courseNumber;

    /**
     * 课程名称
     */
    @Excel(name = "课程名称")
    private String courseName;

    /**
     * 教师编号
     */
    @Excel(name = "教师编号")
    private String teacherNumber;

    private String teacherName;

    /**
     * 补考成绩
     */
    @Excel(name = "补考成绩")
    private BigDecimal resitScore;

    /**
     * 补考次数
     */
    @Excel(name = "补考次数")
    private Integer resitCount;

    /**
     * 学年
     */
    @Excel(name = "学年")
    private Integer startYear;

    /**
     * 上/下学期
     */
    @Excel(name = "上/下学期")
    private String semester;

    /**
     * 学生编号
     */
    @Excel(name = "学生编号")
    private String studentNumber;

    private String studentName;


    private boolean reply;

    public boolean isReply() {
        return reply;
    }

    public void setReply(boolean reply) {
        this.reply = reply;
    }


    public String getTeacherName() {
        return teacherName;
    }

    public void setTeacherName(String teacherName) {
        this.teacherName = teacherName;
    }

    public String getStudentName() {
        return studentName;
    }

    public void setStudentName(String studentName) {
        this.studentName = studentName;
    }

    public void setCourseResitId(Long courseResitId) {
        this.courseResitId = courseResitId;
    }

    public Long getCourseResitId() {
        return courseResitId;
    }

    public void setCourseNumber(String courseNumber) {
        this.courseNumber = courseNumber;
    }

    public String getCourseNumber() {
        return courseNumber;
    }

    public void setCourseName(String courseName) {
        this.courseName = courseName;
    }

    public String getCourseName() {
        return courseName;
    }

    public void setTeacherNumber(String teacherNumber) {
        this.teacherNumber = teacherNumber;
    }

    public String getTeacherNumber() {
        return teacherNumber;
    }

    public void setResitScore(BigDecimal resitScore) {
        this.resitScore = resitScore;
    }

    public BigDecimal getResitScore() {
        return resitScore;
    }

    public void setResitCount(Integer resitCount) {
        this.resitCount = resitCount;
    }

    public Integer getResitCount() {
        return resitCount;
    }

    public void setStartYear(Integer startYear) {
        this.startYear = startYear;
    }

    public Integer getStartYear() {
        return startYear;
    }

    public void setSemester(String semester) {
        this.semester = semester;
    }

    public String getSemester() {
        return semester;
    }

    public void setStudentNumber(String studentNumber) {
        this.studentNumber = studentNumber;
    }

    public String getStudentNumber() {
        return studentNumber;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                .append("courseResitId", getCourseResitId())
                .append("courseNumber", getCourseNumber())
                .append("courseName", getCourseName())
                .append("teacherNumber", getTeacherNumber())
                .append("resitScore", getResitScore())
                .append("resitCount", getResitCount())
                .append("startYear", getStartYear())
                .append("semester", getSemester())
                .append("studentNumber", getStudentNumber())
                .append("createTime", getCreateTime())
                .append("createBy", getCreateBy())
                .append("updateTime", getUpdateTime())
                .append("updateBy", getUpdateBy())
                .append("remark", getRemark())
                .toString();
    }

    public String check(CourseResit courseResit) {
        if (StringUtils.isBlank(courseResit.getTeacherNumber())) {
            return "教师工号不能为空！";
        }
        if (StringUtils.isBlank(courseResit.getStudentNumber())) {
            return "学生学号不能为空！";
        }
        if (StringUtils.isBlank(courseResit.getCourseName())) {
            return "课程名称不能为空！";
        }
        if (StringUtils.isBlank(courseResit.getCourseNumber())) {
            return "课程编号不能为空！";
        }
        if (StringUtils.isBlank(courseResit.getSemester())) {
            return "学期不能为空！";
        }
        if (courseResit.getStartYear() == null) {
            return "学年不能为空！";
        }
        if (courseResit.getResitScore() == null) {
            return "补考得分不能为空！";
        }
        if (courseResit.getResitCount() == null) {
            return "补考次数不能为空！";
        }
        return null;
    }
}
